

function projectGallery(pageName)
{
	var totalProjects = 4;
	
	var prevPage = 0;
	if(pageName == 'Home')
		prevPage = totalProjects - 1;
	else if(pageName == 0)
		prevPage = totalProjects - 1;		
	else
		prevPage = pageName - 1;
	
	var nextPage = 0;
	if(pageName == "Home")
		nextPage = 0;
	else if((pageName+1) == totalProjects)
		nextPage = 0;
	else
		nextPage = pageName + 1;
	
	document.write('<a href="project_page'+prevPage+'.html" class="nextButton">Previous</a><a href="project_page'+nextPage+'.html" class="nextButton">Next</a>');

	
	/*
	 * Home Page
	 */
	if(pageName == 'Home')
	{
		document.write('<a href="project_page0.html"><img src="images/project_be_thum.png" /></a>');
		document.write('<a href="project_page1.html"><img src="images/project_webscan_thum.png" /></a>');
		document.write('<a href="project_page2.html"><img src="images/project_hotspots_thum.png" /></a>');
		document.write('<a href="project_page3.html"><img src="images/project_magicmailbox_thum.png" /></a>');
	}
	/* 
	 * XBOX
	 */
	else if(pageName == 0)
	{
		document.write('<a href="project_page0.html"><img src="images/project_be_thum.png" class="here" /></a>');
		document.write('<a href="project_page1.html"><img src="images/project_webscan_thum.png"/></a>');
		document.write('<a href="project_page2.html"><img src="images/project_hotspots_thum.png" /></a>');
		document.write('<a href="project_page3.html"><img src="images/project_magicmailbox_thum.png" /></a>');
	}
	/*
	 * Webscan
	 */
	else if(pageName == 1)
	{
		document.write('<a href="project_page0.html"><img src="images/project_be_thum.png" /></a>');
		document.write('<a href="project_page1.html"><img src="images/project_webscan_thum.png" class="here" /></a>');
		document.write('<a href="project_page2.html"><img src="images/project_hotspots_thum.png" /></a>');
		document.write('<a href="project_page3.html"><img src="images/project_magicmailbox_thum.png" /></a>');
	}
	/* 
	 * Hotspots
	 */
	else if(pageName == 2)
	{
		document.write('<a href="project_page0.html"><img src="images/project_be_thum.png" /></a>');
		document.write('<a href="project_page1.html"><img src="images/project_webscan_thum.png" /></a>');
		document.write('<a href="project_page2.html"><img src="images/project_hotspots_thum.png" class="here" /></a>');
		document.write('<a href="project_page3.html"><img src="images/project_magicmailbox_thum.png" /></a>');
	}
	/*
	 * Magic Mailbox
	 */
	else if(pageName == 3)
	{
		document.write('<a href="project_page0.html"><img src="images/project_be_thum.png" /></a>');
		document.write('<a href="project_page1.html"><img src="images/project_webscan_thum.png" /></a>');
		document.write('<a href="project_page2.html"><img src="images/project_hotspots_thum.png" /></a>');
		document.write('<a href="project_page3.html"><img src="images/project_magicmailbox_thum.png" class="here" /></a>');
	}
	/*
	 * error
	 */
	else
	{
		document.write('<a href="project_page0.html"><img src="images/project_be_thum.png" /></a>');
		document.write('<a href="project_page1.html"><img src="images/project_webscan_thum.png" /></a>');
		document.write('<a href="project_page2.html"><img src="images/project_hotspots_thum.png" /></a>');
		document.write('<a href="project_page3.html"><img src="images/project_magicmailbox_thum.png" /></a>');
	}
	
}